﻿using DouDou.Shop.Common.Models;
using DouDou.Shop.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DouDou.Shop.Interface
{
    public interface IUserService
    {
        /**
    * 校验用户对象数据类型
    * @param data
    * @param type
    * @return
    */
        AjaxResult CheckData(string data, int type);

        /**
         * 发送验证码
         * @param phone
         */
        AjaxResult SendVerifyCode(string phone);

        /// <summary>
        /// 发送验证码前验证
        /// </summary>
        /// <param name="phone"></param>
        AjaxResult CheckPhoneNumberBeforeSend(string phone);

        /// <summary>
        /// 用户注册
        /// </summary>
        /// <param name="user"></param>
        /// <param name="code"></param>
        void Register(TbUser user, string code);

        /// <summary>
        /// 根据用户名和密码查询用户
        /// </summary>
        /// <param name="username"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        TbUser QueryUser(string username, string password);
    }
}
